-module(game_app).
-include("common.hrl").

-export([start/2,stop/1]).

start(_StartType, _StartArgs) -> 
	util:sleep(1000),
io:format("111111111111111111111111~n"),
	{ok, Host} = application:get_env(dbhost),
	{ok, Port} = application:get_env(dbport),
	{ok, Usr} = application:get_env(dbusr),
	{ok, Psw} = application:get_env(dbpsw),
	{ok, Database} = application:get_env(dbdatabase),
	{ok, Code} = application:get_env(dbcode),

	{ok, NetPort} = application:get_env(port),
	
	do_start([Host,Port,Usr,Psw,Database,Code,NetPort]).

stop(_State) ->
    ok.

do_start(Data)-> 
    case game_sup:start_link(Data) of      
        {ok, Pid} -> {ok, Pid};
        Other ->     {error, Other}
    end.


